<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="__STATIC__/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
</head>
<body class="gray-bg">
{include file="comm/left"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>评价 <small>详情</small></h5>
                    <div class="ibox-tools">
                        <div class="switch">
                            <div class="onoffswitch">
                                <input type="checkbox" {if $audit==1} checked {/if} class="onoffswitch-checkbox" id="audit">
                                <label class="onoffswitch-label" for="audit">
                                    <span class="onoffswitch-inner"></span>
                                    <span class="onoffswitch-switch"></span>
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-tools">
                        审核默认开关：
                    </div>
                </div>
                <div class="ibox-content">

                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                            <tr>
                                <th></th>
                                <th width="90px">评价影音</th>
                                <th>评价内容</th>
                                <th>评价人</th>
                                <th width=7%>浏览量</th>
                                <th width=7%>是否置顶</th>
                                <th width=7%>是否通过审核</th>
                                <th width=10%>评价时间</th>
                                <th width=12%>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach $evalute as $k}
                            <tr class="gradeX" width="90px">
                                <th>{$i++}</th>
                                <th>
                                    {if $k.filetype=='image'}<img src="{$k.filename}" alt="" width="90px" height="60px">
                                    {else if $k.filetype=='video'}<video height="60px" src="{$k.filename}"></video>
                                    {/if}
                                </th>
                                <th>{$k.txt}</th>
                                <th>{$k.user}</th>
                                <th>{$k.browsenum}</th>
                                <th>
                                    <div class="switch">
                                        <div class="onoffswitch">
                                            <input type="checkbox" {if $k.stick=="1" }checked{/if} class="onoffswitch-checkbox zhiding" id="{$k.id}">
                                            <label class="onoffswitch-label" for="{$k.id}">
                                                <span class="onoffswitch-inner"></span>
                                                <span class="onoffswitch-switch"></span>
                                            </label>
                                        </div>
                                    </div>
                                </th>
                                <th>
                                    <div class="switch">
                                        <div class="onoffswitch">
                                            <input type="checkbox" {if $k.audit=="1" }checked{/if} class="onoffswitch-checkbox shenhe" id="{$k.id}{$k.audit}" attr_id="{$k.id}">
                                            <label class="onoffswitch-label" for="{$k.id}{$k.audit}">
                                                <span class="onoffswitch-inner"></span>
                                                <span class="onoffswitch-switch"></span>
                                            </label>
                                        </div>
                                    </div>
                                </th>
                                <th>{$k.create_time}</th>
                                <th>
                                    <a  href="{:url('index/evalutes/desc')}?id={$k.id}" class="btn btn-success "><i class="glyphicon glyphicon-tasks"></i> <span class="bold">详情</span></a>
                                    <a  href="javascript:;" onclick="deletel('{:url('index/evalutes/del')}',{$k.id})" class="btn btn-warning del"><i class="fa fa-warning"></i><span class="bold">删除</span></a>
                                </th>
                            </tr>
                            {/foreach}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__STATIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/js/bootstrap.min.js?v=3.3.5"></script>
<script src="__STATIC__/js/plugins/jeditable/jquery.jeditable.js"></script>
<script src="__STATIC__/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="__STATIC__/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="__STATIC__/js/content.min.js?v=1.0.0"></script>
<script>
$(function(){
    $('#audit').click(function(){
        var id=$(this).attr('id');
        var checked=document.getElementById(id).checked;
        var url="{:url('index/evalutes/setAudit')}";
        $.post(url,{checked:checked});
    });
});
$(function(){
    $('.zhiding').click(function(){
        var id=$(this).attr('id');
        var checked=document.getElementById(id).checked;
        var url="{:url('index/evalutes/updstick')}";
        $.post(url,{id:id,checked:checked});
    });
});
$(function(){
    $('.shenhe').click(function(){
        var rid=$(this).attr('id');
        var did=$(this).attr('attr_id');
        var checked=document.getElementById(rid).checked;
        var url="{:url('index/evalutes/updaudit')}";
        $.post(url,{id:did,checked:checked});
    });
});
$(document).ready(function(){$(".dataTables-example").dataTable();var oTable=$("#editable").dataTable();oTable.$("td").editable("../example_ajax.php",{"callback":function(sValue,y){var aPos=oTable.fnGetPosition(this);oTable.fnUpdate(sValue,aPos[0],aPos[1])},"submitdata":function(value,settings){return{"row_id":this.parentNode.getAttribute("id"),"column":oTable.fnGetPosition(this)[2]}},"width":"90%","height":"100%"})});function fnClickAddRow(){$("#editable").dataTable().fnAddData(["Custom row","New row","New row","New row","New row"])};
</script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>
</html>
